import { defineStore } from "pinia";
import { Topology } from "@topology/core";
const useTopology = defineStore("topology", {
	// 推荐使用 完整类型推断的箭头函数
	state: (): {
		topology: Topology | null
		preViewTopology: Topology | null
	} => {
		return {
			// 所有这些属性都将自动推断其类型
			topology: null,
			preViewTopology: null,
		};
	},
	getters: {
		getTopology: (state) => state.topology,
	},
	actions: {
		changeTopology(data: Topology) {
			this.topology = data;
		},
	},
});
export default useTopology;
